#!/usr/bin/env node

const fs=require('fs');
const file=process.argv[2];
var content;

//console.log(__filename);//__dirname：目录名
try{
  if(typeof file==='undefined'){
    content=fs.readFileSync(__filename,'utf8');
  }else{
    content=fs.readFileSync(file,'utf8');//同步的错误处理直接try-catch}
}
  console.log(content);
  
}catch(e){
  console.error(e.message);
}

